import httpUtil from '../utils/request'

export function tablePage(ns,ds,tableName,page,limit){
  const params = {
      ns,
      ds,
      tableName,
      page,
      limit
  }
  return httpUtil({
      url: '/db/table/page',
      method: 'get',
      params: params
  })
}

export function tableColumns(ns,ds,tableName){
  const params = {
    ns,
    ds,
    tableName
  }
    return httpUtil({
        url: '/db/table/columns',
        method: 'get',
        params: params
    })
}

export function previewTable(data){
    return httpUtil({
        url: '/db/table/preview',
        method: 'post',
        data: data
    })
}

export function generatorCode(data){
  return httpUtil({
      url: '/db/table/code',
      method: 'post',
      data: data,
      responseType: 'blob'
  })
}